home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / net / sun3.md / netLEMachInt.h < prev    next >
C/C++ Source or Header  |  1991-03-19  |  2KB  |  59 lines

  1. /*
  2.  * netLEMachInt.h --
  3.  *
  4.  *    Internal definitions for the sun3 LANCE controller.
  5.  *
  6.  * Copyright 1990 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  */
  15.  
  16. #ifndef _NETLEMACHINT
  17. #define _NETLEMACHINT
  18.  
  19. #include <netInt.h>
  20.  
  21. /*
  22.  * Register address port and register data port definition.
  23.  */
  24.  
  25. typedef struct NetLEMach_Reg {
  26.     volatile unsigned short    dataPort;    /* RDP */
  27.         volatile unsigned short    addrPort[1];    /* RAP */
  28. } NetLEMach_Reg;
  29.  
  30. #define NET_LE_REG_SIZE    4
  31.  
  32. #define NET_LE_CONTROL_REG_ADDR 0xfe10000
  33.  
  34. /*
  35.  * On the sun4c we don't have to copy packets because they are mapped
  36.  * into DVMA space.
  37.  */
  38.  
  39. #define NET_LE_COPY_PACKET FALSE
  40.  
  41. /*
  42.  * Macros for converting chip to cpu and cpu to chip address.
  43.  * We always deal with chip addresses in two parts, the lower 16 bits
  44.  * and the upper 8 bits.
  45.  */
  46. #define    NET_LE_FROM_CHIP_ADDR(statePtr, high,low)    \
  47.         ((Address) (0xf000000 + ((high) << 16) + (low)))
  48.  
  49. #define    NET_LE_TO_CHIP_ADDR_LOW(a) ( ((unsigned int) (a)) & 0xffff)
  50. #define    NET_LE_TO_CHIP_ADDR_HIGH(a) ( (((unsigned int) (a)) >> 16) & 0xff)
  51.  
  52. /* 
  53.  * Routine to allocate a network buffer.
  54.  */
  55. #define BufAlloc(statePtr, numBytes) \
  56.     (char *) VmMach_NetMemAlloc(numBytes);
  57.  
  58. #endif /* _NETLEMACHINT */
  59.